<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<script>
    export default {
        data(){
            return{
            }
        },
        beforeRouteEnter(to,from,next) {
            console.log("路由被调用了");
            next();
        },
        beforeRouteUpdate(to,from,next){
            console.log("在当前路由改变，但该组件被复用时调用："+thia.name);
            next();
        },
        beforeRouteLeave(to,from,next){
            console.log("导航离开该组件的对应路由时调用,去往的页面路径："+this.path);
            next();
        }
    }
</script>
</body>
</html>